Optimal. Leaf size=123 \[ -\frac {4 a^3 (A-2 i B)}{c^2 f (\tan (e+f x)+i)}+\frac {2 a^3 (B+i A)}{c^2 f (\tan (e+f x)+i)^2}-\frac {a^3 (5 B+i A) \log (\cos (e+f x))}{c^2 f}+\frac {a^3 x (A-5 i B)}{c^2}+\frac {i a^3 B \tan (e+f x)}{c^2 f} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.18, antiderivative size = 123, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 41, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.049, Rules used = {3588, 77} \[ -\frac {4 a^3 (A-2 i B)}{c^2 f (\tan (e+f x)+i)}+\frac {2 a^3 (B+i A)}{c^2 f (\tan (e+f x)+i)^2}-\frac {a^3 (5 B+i A) \log (\cos (e+f x))}{c^2 f}+\frac {a^3 x (A-5 i B)}{c^2}+\frac {i a^3 B \tan (e+f x)}{c^2 f} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 77
Rule 3588
Rubi steps
\begin {align*} \int \frac {(a+i a \tan (e+f x))^3 (A+B \tan (e+f x))}{(c-i c \tan (e+f x))^2} \, dx &=\frac {(a c) \operatorname {Subst}\left (\int \frac {(a+i a x)^2 (A+B x)}{(c-i c x)^3} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac {(a c) \operatorname {Subst}\left (\int \left (\frac {i a^2 B}{c^3}-\frac {4 i a^2 (A-i B)}{c^3 (i+x)^3}+\frac {4 a^2 (A-2 i B)}{c^3 (i+x)^2}+\frac {a^2 (i A+5 B)}{c^3 (i+x)}\right ) \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac {a^3 (A-5 i B) x}{c^2}-\frac {a^3 (i A+5 B) \log (\cos (e+f x))}{c^2 f}+\frac {i a^3 B \tan (e+f x)}{c^2 f}+\frac {2 a^3 (i A+B)}{c^2 f (i+\tan (e+f x))^2}-\frac {4 a^3 (A-2 i B)}{c^2 f (i+\tan (e+f x))}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] time = 10.09, size = 1063, normalized size = 8.64 \[ \frac {x \left (\frac {A \cos ^3(e)}{2 c^2}-\frac {5 i B \cos ^3(e)}{2 c^2}-\frac {2 i A \sin (e) \cos ^2(e)}{c^2}-\frac {10 B \sin (e) \cos ^2(e)}{c^2}-\frac {3 A \sin ^2(e) \cos (e)}{c^2}+\frac {15 i B \sin ^2(e) \cos (e)}{c^2}-\frac {A \cos (e)}{2 c^2}+\frac {5 i B \cos (e)}{2 c^2}+\frac {2 i A \sin ^3(e)}{c^2}+\frac {10 B \sin ^3(e)}{c^2}+\frac {i A \sin (e)}{c^2}+\frac {5 B \sin (e)}{c^2}+\frac {A \sin ^3(e) \tan (e)}{2 c^2}-\frac {5 i B \sin ^3(e) \tan (e)}{2 c^2}+\frac {A \sin (e) \tan (e)}{2 c^2}-\frac {5 i B \sin (e) \tan (e)}{2 c^2}+i (A-5 i B) \left (\frac {\cos (3 e)}{c^2}-\frac {i \sin (3 e)}{c^2}\right ) \tan (e)\right ) (i \tan (e+f x) a+a)^3 (A+B \tan (e+f x)) \cos ^4(e+f x)}{(\cos (f x)+i \sin (f x))^3 (A \cos (e+f x)+B \sin (e+f x))}+\frac {(A-3 i B) \left (\frac {i \sin (e)}{c^2}-\frac {\cos (e)}{c^2}\right ) \sin (2 f x) (i \tan (e+f x) a+a)^3 (A+B \tan (e+f x)) \cos ^4(e+f x)}{f (\cos (f x)+i \sin (f x))^3 (A \cos (e+f x)+B \sin (e+f x))}+\frac {(A-i B) \left (\frac {\cos (e)}{2 c^2}+\frac {i \sin (e)}{2 c^2}\right ) \sin (4 f x) (i \tan (e+f x) a+a)^3 (A+B \tan (e+f x)) \cos ^4(e+f x)}{f (\cos (f x)+i \sin (f x))^3 (A \cos (e+f x)+B \sin (e+f x))}+\frac {(i A+3 B) \cos (2 f x) \left (\frac {\cos (e)}{c^2}-\frac {i \sin (e)}{c^2}\right ) (i \tan (e+f x) a+a)^3 (A+B \tan (e+f x)) \cos ^4(e+f x)}{f (\cos (f x)+i \sin (f x))^3 (A \cos (e+f x)+B \sin (e+f x))}+\frac {(A-i B) \cos (4 f x) \left (\frac {\sin (e)}{2 c^2}-\frac {i \cos (e)}{2 c^2}\right ) (i \tan (e+f x) a+a)^3 (A+B \tan (e+f x)) \cos ^4(e+f x)}{f (\cos (f x)+i \sin (f x))^3 (A \cos (e+f x)+B \sin (e+f x))}+\frac {(A-5 i B) \left (\frac {f x \cos (3 e)}{c^2}-\frac {i f x \sin (3 e)}{c^2}\right ) (i \tan (e+f x) a+a)^3 (A+B \tan (e+f x)) \cos ^4(e+f x)}{f (\cos (f x)+i \sin (f x))^3 (A \cos (e+f x)+B \sin (e+f x))}+\frac {(A-5 i B) \left (-\frac {i \cos (3 e) \log \left (\cos ^2(e+f x)\right )}{2 c^2}-\frac {\sin (3 e) \log \left (\cos ^2(e+f x)\right )}{2 c^2}\right ) (i \tan (e+f x) a+a)^3 (A+B \tan (e+f x)) \cos ^4(e+f x)}{f (\cos (f x)+i \sin (f x))^3 (A \cos (e+f x)+B \sin (e+f x))}+\frac {i B \left (\frac {\cos (3 e)}{c^2}-\frac {i \sin (3 e)}{c^2}\right ) \sin (f x) (i \tan (e+f x) a+a)^3 (A+B \tan (e+f x)) \cos ^3(e+f x)}{f \left (\cos \left (\frac {e}{2}\right )-\sin \left (\frac {e}{2}\right )\right ) \left (\cos \left (\frac {e}{2}\right )+\sin \left (\frac {e}{2}\right )\right ) (\cos (f x)+i \sin (f x))^3 (A \cos (e+f x)+B \sin (e+f x))} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 1.20, size = 136, normalized size = 1.11 \[ \frac {{\left (-i \, A - B\right )} a^{3} e^{\left (6 i \, f x + 6 i \, e\right )} + {\left (i \, A + 5 \, B\right )} a^{3} e^{\left (4 i \, f x + 4 i \, e\right )} + {\left (2 i \, A + 6 \, B\right )} a^{3} e^{\left (2 i \, f x + 2 i \, e\right )} - 4 \, B a^{3} + {\left ({\left (-2 i \, A - 10 \, B\right )} a^{3} e^{\left (2 i \, f x + 2 i \, e\right )} + {\left (-2 i \, A - 10 \, B\right )} a^{3}\right )} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right )}{2 \, {\left (c^{2} f e^{\left (2 i \, f x + 2 i \, e\right )} + c^{2} f\right )}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [B] time = 2.31, size = 357, normalized size = 2.90 \[ \frac {\frac {6 \, {\left (-i \, A a^{3} - 5 \, B a^{3}\right )} \log \left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 1\right )}{c^{2}} + \frac {12 \, {\left (i \, A a^{3} + 5 \, B a^{3}\right )} \log \left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + i\right )}{c^{2}} - \frac {6 \, {\left (i \, A a^{3} + 5 \, B a^{3}\right )} \log \left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - 1\right )}{c^{2}} - \frac {6 \, {\left (-i \, A a^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - 5 \, B a^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} + 2 i \, B a^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + i \, A a^{3} + 5 \, B a^{3}\right )}}{{\left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - 1\right )} c^{2}} - \frac {25 i \, A a^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{4} + 125 \, B a^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{4} - 100 \, A a^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} + 548 i \, B a^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} - 198 i \, A a^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - 894 \, B a^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} + 100 \, A a^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - 548 i \, B a^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 25 i \, A a^{3} + 125 \, B a^{3}}{c^{2} {\left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + i\right )}^{4}}}{6 \, f} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.19, size = 160, normalized size = 1.30 \[ \frac {i a^{3} B \tan \left (f x +e \right )}{c^{2} f}+\frac {8 i a^{3} B}{f \,c^{2} \left (\tan \left (f x +e \right )+i\right )}-\frac {4 a^{3} A}{f \,c^{2} \left (\tan \left (f x +e \right )+i\right )}+\frac {i a^{3} A \ln \left (\tan \left (f x +e \right )+i\right )}{f \,c^{2}}+\frac {5 a^{3} B \ln \left (\tan \left (f x +e \right )+i\right )}{f \,c^{2}}+\frac {2 i a^{3} A}{f \,c^{2} \left (\tan \left (f x +e \right )+i\right )^{2}}+\frac {2 a^{3} B}{f \,c^{2} \left (\tan \left (f x +e \right )+i\right )^{2}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [F(-2)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: RuntimeError} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 9.16, size = 182, normalized size = 1.48 \[ -\frac {a^3\,\left (7\,B\,\mathrm {tan}\left (e+f\,x\right )+B\,6{}\mathrm {i}+A\,\mathrm {tan}\left (e+f\,x\right )\,4{}\mathrm {i}-2\,A+B\,{\mathrm {tan}\left (e+f\,x\right )}^2\,2{}\mathrm {i}+B\,{\mathrm {tan}\left (e+f\,x\right )}^3-A\,\ln \left (\mathrm {tan}\left (e+f\,x\right )+1{}\mathrm {i}\right )+B\,\ln \left (\mathrm {tan}\left (e+f\,x\right )+1{}\mathrm {i}\right )\,5{}\mathrm {i}+A\,\ln \left (\mathrm {tan}\left (e+f\,x\right )+1{}\mathrm {i}\right )\,\mathrm {tan}\left (e+f\,x\right )\,2{}\mathrm {i}+10\,B\,\ln \left (\mathrm {tan}\left (e+f\,x\right )+1{}\mathrm {i}\right )\,\mathrm {tan}\left (e+f\,x\right )+A\,\ln \left (\mathrm {tan}\left (e+f\,x\right )+1{}\mathrm {i}\right )\,{\mathrm {tan}\left (e+f\,x\right )}^2-B\,\ln \left (\mathrm {tan}\left (e+f\,x\right )+1{}\mathrm {i}\right )\,{\mathrm {tan}\left (e+f\,x\right )}^2\,5{}\mathrm {i}\right )\,1{}\mathrm {i}}{c^2\,f\,{\left (-1+\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}\right )}^2} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 1.00, size = 241, normalized size = 1.96 \[ \frac {2 B a^{3}}{- c^{2} f e^{2 i e} e^{2 i f x} - c^{2} f} - \frac {i a^{3} \left (A - 5 i B\right ) \log {\left (e^{2 i f x} + e^{- 2 i e} \right )}}{c^{2} f} + \begin {cases} \frac {\left (2 i A a^{3} c^{2} f e^{2 i e} + 6 B a^{3} c^{2} f e^{2 i e}\right ) e^{2 i f x} + \left (- i A a^{3} c^{2} f e^{4 i e} - B a^{3} c^{2} f e^{4 i e}\right ) e^{4 i f x}}{2 c^{4} f^{2}} & \text {for}\: 2 c^{4} f^{2} \neq 0 \\- \frac {x \left (- 2 A a^{3} e^{4 i e} + 2 A a^{3} e^{2 i e} + 2 i B a^{3} e^{4 i e} - 6 i B a^{3} e^{2 i e}\right )}{c^{2}} & \text {otherwise} \end {cases} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________